package com.hly.musicbackground.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hly.musicbackground.domain.SongLink;
import com.hly.musicbackground.model.music.VO.SongLinkVO;
import com.hly.musicbackground.model.music.params.SongLinkListParams;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface SongLinkDao extends BaseMapper<SongLink> {

    @Select("select A.create_time createTime, A.rid rid, B.name name, B.pic pic, B.pic120 pic120, " +
            "B.song_time_minutes songTimeMinutes, B.hasmv hasmv, B.artist artist, B.release_date releaseDate " +
            "from song_link as A join song as B on A.rid = B.rid " +
            "where A.type = #{type} and A.link = #{link} limit #{page},#{limit}")
    List<SongLinkVO> selectSongList(String type, int link, int page, int limit);
}
